import React, { Component } from 'react'
import avatorURL from '../../../../../images/profile photo.jpg'
import '../../componentStyle/my/myInfo.scss'
import MyInfoSubItem from './MyInfoSubItem';
import Driver from '../common/Driver';
import { _getUserDetail } from '../common/Api';

export default class MyInfo extends Component {
    constructor(props){
        super(props)

        this.state={
            myInfo: null
        }

        this.getUserDetail()
    }

    async getUserDetail(){
        const res = await _getUserDetail();

        console.log(res);
    }

    render() {
        return (
            <div style={{
                position: 'relative',
            }}>
                <img src={avatorURL} alt="头像" className="avator" style={{
                    borderRadius: '50%'
                }} />
                <div className='content'>
                    <div className='nickname'>幽辰</div>
                    <MyInfoSubItem label='年级' value={2018} />
                    <MyInfoSubItem label='年级' value={2018} />
                    <MyInfoSubItem label='年级' value={2018} />
                    <MyInfoSubItem label='年级' value={2018} />
                    <MyInfoSubItem label='年级' value={2018} />
                    <Driver />
                </div>
            </div>
            // TODO: 与后端对接，获取数据，渲染页面
        )
    }
}
